<template>
  <!-- 访客记录-详情 -->
  <div>
    <public-modal
      width="1000px"
      :footer="false"
      title="实有房屋详情页"
      modalStyle="detailModal"
      :publicVisible="publicVisible"
      cancelContext="拒绝"
      confirmContext="通过"
      @handleOk="handleOk"
      @cancel="cancel"
    >
      <div slot="content">
        <div class="common-title">
          <div class="icon"></div>
          <div class="content">房屋基本信息</div>
        </div>
        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">标准地址</div>
              <div class="value common-value">{{ isTsyfwinfo.infoNames || '暂无' }}</div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">房屋类型</div>
              <div class="value common-value">{{ isTsyfwinfo.fFwlx || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">房屋用途</div>
              <div class="value common-value">
                {{ isTsyfwinfo.fFwyt || '暂无' }}
              </div>
            </div>
          </div>
        </div>

        <div class="common-title">
          <div class="icon"></div>
          <div class="content">房屋负责人</div>
        </div>
        <div class="content-wrapper">
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">人员类型</div>
              <div class="value common-value">{{ policeHouseMainsList.trusteeship == 0 ? '房主本人' : '托管人' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">人员姓名</div>
              <div class="value common-value">
                {{ policeHouseMainsList.userName || '暂无' }}
              </div>
            </div>
          </div>
          <div class="flex">
            <div class="info-wrap f1">
              <div class="label common-lable">身份证号</div>
              <div class="value common-value">{{ policeHouseMainsList.idCard || '暂无' }}</div>
            </div>
            <div class="info-wrap f1">
              <div class="label common-lable">联系电话</div>
              <div class="value common-value">
                {{ policeHouseMainsList.phone || '暂无' }}
              </div>
            </div>
          </div>
        </div>
        <!-- 如果有重点房屋信息 -->
        <template v-if="isTsyfwinfo.fIszdgz === '1'">
          <div class="common-title">
            <div class="icon"></div>
            <div class="content">重点房屋信息</div>
          </div>
          <div class="content-wrapper">
            <div class="flex">
              <div class="info-wrap f1">
                <div class="label common-lable">重点房屋类型</div>
                <div class="value common-value">{{ isTsyfwinfo.fZdgzFwlx || '暂无' }}</div>
              </div>
              <div class="info-wrap f1">
                <div class="label common-lable">设置原因</div>
                <div class="value common-value">
                  {{ isTsyfwinfo.fZdgzYy || '暂无' }}
                </div>
              </div>
            </div>
            <div class="flex">
              <div class="info-wrap f1">
                <div class="label common-lable">设置时间</div>
                <div class="value common-value">{{ isTsyfwinfo.fZdgzSj || '暂无' }}</div>
              </div>
              <div class="info-wrap f1">
                <div class="label common-lable">设置人账号</div>
                <div class="value common-value">
                  {{ isTsyfwinfo.seupPersonnel || '暂无' }}
                </div>
              </div>
            </div>
          </div>
        </template>
      </div>
      <div slot="footer"></div>
    </public-modal>
  </div>
</template>
<script>
import startEndTime from '@/components/startEndTime'
import publicModal from '@/components/publicModal'
import { JeecgListMixin } from '@/mixins/JeecgListMixin'
import { houseDetails } from '@/api/api'
import { template } from 'xe-utils/methods'
export default {
  name: 'houseDetail',
  components: { publicModal, startEndTime },
  mixins: [JeecgListMixin],
  data() {
    return {
      url: {
        list: '/common/project_company_serve_record/page',
      },
      publicVisible: false,
      columns: [
        {
          title: '服务名称',
          dataIndex: 'serveTitle',
          ellipsis: true,
          align: 'center',
        },
        {
          title: '服务时段',
          align: 'center',
          width: 400,
          scopedSlots: { customRender: 'time' },
          ellipsis: true,
        },
        {
          title: '服务民(辅)警',
          align: 'center',
          dataIndex: 'policeUserNames',
          ellipsis: true,
        },
        {
          title: '操作',
          scopedSlots: { customRender: 'action' },
          align: 'center',
        },
      ],
      project_company_type: [],
      queryParams: { pageSize: 5 },
      ipagination: { pageSize: 5 },
      disableMixinCreated: true,
      isTsyfwinfo: {},
      policeHouseMainsList: {},
    }
  },

  methods: {
    async show(records) {
      this.publicVisible = true
      this.getDetail(records)
    },
    getDetail(records) {
      const params = {
        id: records.fHouseid,
      }
      houseDetails(params).then((res) => {
        if (res.code == 200) {
          const { isTsyfwinfo, policeHouseMainsList } = res.result
          this.isTsyfwinfo = isTsyfwinfo
          this.policeHouseMainsList = policeHouseMainsList
        } else {
        }
      })
    },
    handleOk() {
      this.publicVisible = false
    },

    cancel(target) {
      this.publicVisible = false
    },
  },
}
</script>
<style scoped lang="less">
/deep/ .modalCotent {
  padding: 20px 40px;
  border-radius: 0 0 4px 4px;
}
</style>
